package demoSingleton;

public class Principal {
    private String name;
    private static Principal principal;

    public Principal(String name) {
        this.name = name;
    }

    public static Principal getPrincipal() {
        if (principal == null){
            principal = new Principal("王校长");
        }
        return principal;
    }

    public void notice(String s){
        System.out.println(this.name + "通知：" + s);
    }

    public void file(String s){
        System.out.println(this.name + "发布" + "文件：" + s);
    }
}
